# coding=utf-8

from Mqtt import mqtt_client
from Switch import switch


# 设备端的主函数部分
if __name__ == '__main__':
    try:
        # 开关模块初始化完毕
        switch.init()
        # mqtt 客户端,链接并接收消息
        mqtt_client.start()
    except KeyboardInterrupt as e:
        print(e)
        # 开关模块反初始化
        switch.uninit()
